﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

using WebKit;
using WebKit.DOM;
using WebKit.Properties;

namespace browserplayform
{
    public partial class webkitform : Form
    {
        WebKit.WebKitBrowser webkit;
        public webkitform()
        {
            InitializeComponent();
        }

        private void button_go_Click(object sender, EventArgs e)
        {
            try {
                string url_tmp = this.richTextBox_url.Text;
                if (url_tmp != "")
                {
                    this.Controls.Add(webkit);
                    webkit.Navigate(url_tmp);
                }
                
            }
            catch(Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }

        private void webkitform_Load(object sender, EventArgs e)
        {
            try
            {
                webkit = new WebKit.WebKitBrowser();
                webkit.Dock = DockStyle.Fill;
                
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }

        }

        private void webkitform_Shown(object sender, EventArgs e)
        {
            
        }
    }
}
